
from selenium import webdriver
import time

from selenium.webdriver.common.by import By

wd=webdriver.Chrome()
url = 'http://www.baidu.com'
wd.get(url)
time.sleep(2)
a=wd.find_element(By.ID,'kw').send_keys('单依纯')
time.sleep(2)
v=wd.find_element(By.ID,'su').click()
time.sleep(2)
c='document.documentElement.scrolltop=1000000'
wd.execute_script(c)
time.sleep(4)
next_page=wd.find_element(By.XPATH,'//*[@id="page"]/div/a[10]/span').click()
wd.back()
time.sleep(2)
wd.forward()
time.sleep(2)
print(wd.page_source)
wd.close()
